#!/bin/sh
# Set the compilers
export CXX=/usr/bin/clang++-10
# Set the libraries
export IPP_ROOT=/home/ypfan/intel/oneapi/ipp/2021.1.1
export IPP_LIB_DIR=${IPP_ROOT}/lib/intel64
export IPP_INC_DIR=${IPP_ROOT}/include
export MKL_ROOT=/home/ypfan/intel/oneapi/mkl/2021.1.1
export MKL_LIB_DIR=${MKL_ROOT}/lib/intel64
export MKL_INC_DIR=${MKL_ROOT}/include
export GTEST_ROOT=/usr/local
# Only matters if you intend to use Python 
export pybind11_INCLUDE_DIR=/usr/local/lib/python3.8/dist-packages/pybind11-2.6.2.dev1-py3.8.egg/pybind11/share/cmake/pybind11
# Set the working directory
export BUILD_DIR=clang_build 
# Clobber the existing directory for a fresh build
if [ -d ${BUILD_DIR} ]; then
   rm -rf {BUILD_DIR}
fi
mkdir ${BUILD_DIR}
# Descend into build directory 
# shellcheck disable=SC2164
cd ${BUILD_DIR}
# Configure a build release - to disable Python wrapping remove -DRTSEIS_WRAP_PYTHON
cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CXX_FLAGS="-Wall" \
-DRTSEIS_WRAP_PYTHON=TRUE \
-Dpybind11_DIR="/usr/local/lib/python3.8/dist-packages/pybind11-2.6.2.dev1-py3.8.egg/pybind11/share/cmake/pybind11"
make